/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.matrimonysite.entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author khanhnguyen
 */
@Entity
@Table(name = "userPersonal", catalog = "MatrimonySite", schema = "dbo")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "UserPersonal.findAll", query = "SELECT u FROM UserPersonal u"),
    @NamedQuery(name = "UserPersonal.findByPersonalID", query = "SELECT u FROM UserPersonal u WHERE u.personalID = :personalID"),
    @NamedQuery(name = "UserPersonal.findBySelfFeatures", query = "SELECT u FROM UserPersonal u WHERE u.selfFeatures = :selfFeatures"),
    @NamedQuery(name = "UserPersonal.findByFamilyDetails", query = "SELECT u FROM UserPersonal u WHERE u.familyDetails = :familyDetails"),
    @NamedQuery(name = "UserPersonal.findByWorkAt", query = "SELECT u FROM UserPersonal u WHERE u.workAt = :workAt"),
    @NamedQuery(name = "UserPersonal.findByQualificationStatus", query = "SELECT u FROM UserPersonal u WHERE u.qualificationStatus = :qualificationStatus"),
    @NamedQuery(name = "UserPersonal.findByDesignation", query = "SELECT u FROM UserPersonal u WHERE u.designation = :designation"),
    @NamedQuery(name = "UserPersonal.findByFavoriteHobbies", query = "SELECT u FROM UserPersonal u WHERE u.favoriteHobbies = :favoriteHobbies"),
    @NamedQuery(name = "UserPersonal.findByFavoriteMusics", query = "SELECT u FROM UserPersonal u WHERE u.favoriteMusics = :favoriteMusics"),
    @NamedQuery(name = "UserPersonal.findByFavoriteMovies", query = "SELECT u FROM UserPersonal u WHERE u.favoriteMovies = :favoriteMovies"),
    @NamedQuery(name = "UserPersonal.findByFavoriteBooks", query = "SELECT u FROM UserPersonal u WHERE u.favoriteBooks = :favoriteBooks"),
    @NamedQuery(name = "UserPersonal.findByFavoriteCuisines", query = "SELECT u FROM UserPersonal u WHERE u.favoriteCuisines = :favoriteCuisines"),
    @NamedQuery(name = "UserPersonal.findByFavoritePlace", query = "SELECT u FROM UserPersonal u WHERE u.favoritePlace = :favoritePlace")})
public class UserPersonal implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "personalID", nullable = false)
    private Integer personalID;
    @Size(max = 255)
    @Column(name = "selfFeatures", length = 255)
    private String selfFeatures;
    @Size(max = 255)
    @Column(name = "familyDetails", length = 255)
    private String familyDetails;
    @Size(max = 255)
    @Column(name = "workAt", length = 255)
    private String workAt;
    @Size(max = 255)
    @Column(name = "qualificationStatus", length = 255)
    private String qualificationStatus;
    @Size(max = 255)
    @Column(name = "designation", length = 255)
    private String designation;
    @Size(max = 255)
    @Column(name = "favoriteHobbies", length = 255)
    private String favoriteHobbies;
    @Size(max = 255)
    @Column(name = "favoriteMusics", length = 255)
    private String favoriteMusics;
    @Size(max = 255)
    @Column(name = "favoriteMovies", length = 255)
    private String favoriteMovies;
    @Size(max = 255)
    @Column(name = "favoriteBooks", length = 255)
    private String favoriteBooks;
    @Size(max = 255)
    @Column(name = "favoriteCuisines", length = 255)
    private String favoriteCuisines;
    @Size(max = 255)
    @Column(name = "favoritePlace", length = 255)
    private String favoritePlace;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "userPersonal")
    private Users users;
    @JoinColumn(name = "cityID", referencedColumnName = "cityID")
    @ManyToOne
    private City cityID;

    public UserPersonal() {
    }

    public UserPersonal(Integer personalID) {
        this.personalID = personalID;
    }

    public Integer getPersonalID() {
        return personalID;
    }

    public void setPersonalID(Integer personalID) {
        this.personalID = personalID;
    }

    public String getSelfFeatures() {
        return selfFeatures;
    }

    public void setSelfFeatures(String selfFeatures) {
        this.selfFeatures = selfFeatures;
    }

    public String getFamilyDetails() {
        return familyDetails;
    }

    public void setFamilyDetails(String familyDetails) {
        this.familyDetails = familyDetails;
    }

    public String getWorkAt() {
        return workAt;
    }

    public void setWorkAt(String workAt) {
        this.workAt = workAt;
    }

    public String getQualificationStatus() {
        return qualificationStatus;
    }

    public void setQualificationStatus(String qualificationStatus) {
        this.qualificationStatus = qualificationStatus;
    }

    public String getDesignation() {
        return designation;
    }

    public void setDesignation(String designation) {
        this.designation = designation;
    }

    public String getFavoriteHobbies() {
        return favoriteHobbies;
    }

    public void setFavoriteHobbies(String favoriteHobbies) {
        this.favoriteHobbies = favoriteHobbies;
    }

    public String getFavoriteMusics() {
        return favoriteMusics;
    }

    public void setFavoriteMusics(String favoriteMusics) {
        this.favoriteMusics = favoriteMusics;
    }

    public String getFavoriteMovies() {
        return favoriteMovies;
    }

    public void setFavoriteMovies(String favoriteMovies) {
        this.favoriteMovies = favoriteMovies;
    }

    public String getFavoriteBooks() {
        return favoriteBooks;
    }

    public void setFavoriteBooks(String favoriteBooks) {
        this.favoriteBooks = favoriteBooks;
    }

    public String getFavoriteCuisines() {
        return favoriteCuisines;
    }

    public void setFavoriteCuisines(String favoriteCuisines) {
        this.favoriteCuisines = favoriteCuisines;
    }

    public String getFavoritePlace() {
        return favoritePlace;
    }

    public void setFavoritePlace(String favoritePlace) {
        this.favoritePlace = favoritePlace;
    }

    public Users getUsers() {
        return users;
    }

    public void setUsers(Users users) {
        this.users = users;
    }

    public City getCityID() {
        return cityID;
    }

    public void setCityID(City cityID) {
        this.cityID = cityID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (personalID != null ? personalID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserPersonal)) {
            return false;
        }
        UserPersonal other = (UserPersonal) object;
        if ((this.personalID == null && other.personalID != null) || (this.personalID != null && !this.personalID.equals(other.personalID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.matrimonysite.entity.UserPersonal[ personalID=" + personalID + " ]";
    }
    
}
